#include <iostream>
#include <vector>
#include <algorithm>
#include<string>

using namespace std;

template <typename T>
void swapNum(T& a, T& b) {
	T temp;
	temp = a;
	a = b;
	b = temp;
}

int main() {
	cout << "请输入两个数字： \n";
	int a, b;
	cin >> a >> b;
	cout << "交换前a=" << a << " b=" << b<<endl;
	swapNum(a, b);
	cout << "交换后a=" << a << " b=" << b<<endl<<endl;

	cout << "请输入两个浮点数： \n";
	double c, d;
	cin >> c >> d;
	cout << "交换前c=" <<c << " d=" << d << endl;
	swapNum(c,d);
	cout << "交换后c=" << c << " d=" << d << endl;
	return 0;

}

